//
//  SmsCloudSearchView.m
//  smsCloud
//
//  Created by 蓝鳍互娱 on 2024/7/18.
//

#import "SmsCloudSearchView.h"
@interface SmsCloudSearchView()

@end
@implementation SmsCloudSearchView
-(instancetype)init{
    if (self == [super init]) {
        self.layer.cornerRadius = [SmsCloudHead SmsCloudScreewRatio:20];
        self.clipsToBounds = true;
        self.backgroundColor = [SmsCloudHead SmsCloudColorHexString:@"#FFFFFF"];
        [self smsCloudInitView];
    }
    return self;
}
- (void)smsCloudInitView{
    UIImageView * smsCloudHeadImgView = [[UIImageView alloc] init];
    smsCloudHeadImgView.image = [SmsCloudHead SmsCloudImageNamed:@"smsCloudSearch"];
    [self addSubview:smsCloudHeadImgView];
    [smsCloudHeadImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@([SmsCloudHead SmsCloudScreewRatio:26]));
        make.centerY.equalTo(self);
        make.width.equalTo(@([SmsCloudHead SmsCloudScreewRatio:38]));
        make.height.equalTo(@([SmsCloudHead SmsCloudScreewRatio:38]));
    }];
    UIView * smsCloudLineView = [[UIView alloc] init];
    smsCloudLineView.backgroundColor = [SmsCloudHead SmsCloudColorHexString:@"#7799C0"];
    [self addSubview:smsCloudLineView];
    [smsCloudLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(smsCloudHeadImgView.mas_right).offset([SmsCloudHead SmsCloudScreewRatio:30]);
        make.centerY.equalTo(self);
        make.width.equalTo(@([SmsCloudHead SmsCloudScreewRatio:2]));
        make.height.equalTo(@([SmsCloudHead SmsCloudScreewRatio:20]));
    }];
    UILabel * smsCloudSearchLab = [[UILabel alloc] init];
    smsCloudSearchLab.font = [UIFont systemFontOfSize:[SmsCloudHead SmsCloudScreewRatio:30] weight:UIFontWeightSemibold];
    smsCloudSearchLab.textColor = [SmsCloudHead SmsCloudColorHexString:@"#7799C0"];
    smsCloudSearchLab.text = @"请输入你想注册的应用名称";
    [self addSubview:smsCloudSearchLab];
    [smsCloudSearchLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(smsCloudLineView.mas_right).offset([SmsCloudHead SmsCloudScreewRatio:24]);
        make.right.equalTo(@(-[SmsCloudHead SmsCloudScreewRatio:30]));
        make.top.equalTo(@([SmsCloudHead SmsCloudScreewRatio:0]));
        make.bottom.equalTo(@([SmsCloudHead SmsCloudScreewRatio:0]));
    }];
    UIButton * smsCloudSearchBtn = [[UIButton alloc] init];
    [smsCloudSearchBtn addTarget:self action:@selector(smsCloudSearch) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:smsCloudSearchBtn];
    [smsCloudSearchBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(@([SmsCloudHead SmsCloudScreewRatio:0]));
    }];
}
- (void)smsCloudSearch{
    if (self.SmsCloudSearchBlock) {
        self.SmsCloudSearchBlock();
    }
}
@end
